<?php defined ( 'SYSPATH' ) or die ( 'No direct script access.' );
/**
 * Share block class
 * 
 * @author cks
 */
class Block_Post {
	/**
	 * 分布分享页面
	 */
	public static function load($data=array()) {
	
		$view = View::factory ('post/block/load');

		$albums=!empty($data['albums'])?$data['albums']:array();

		$post=!empty($data['post'])?$data['post']:array();

		$tags=!empty($data['tags'])?$data['tags']:array();

		$assort=!empty($data['assort'])?$data['assort']:array();
		
		$view->albums = $albums;
		
		$view->post =$post;

		$view->tags =$tags;

		$view->assort =$assort;
		
		return $view->render();
	}
	public static function detail($share_detail) {
	
		$view = View::factory ('post/block/detail' );
		
		$view->share_detail = $share_detail;
		
		return $view->render();
	}
	public static function post_list($post_list) {

		if(Lib_Base::is_mobile()){

			$view = View::factory ('mobile/post/list');	

		}
		else{

			$view = View::factory ('post/block/list');
		}
		
		$view->post_list = $post_list;
		
		return $view->render();
	}

	public static function book_list($post_list) {

		if(Lib_Base::is_mobile()){

			$view = View::factory ('mobile/book/list');	

		}
		else{

			$view = View::factory ('post/block/book');
		}
		
		$view->post_list = $post_list;
		
		return $view->render();
	}

}